<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>
        {% block title %}
            Titl
        {% endblock %}
    </title>
    {% load static %}
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script src="{% static 'jquery-3.3.1.js' %}"></script>
    <script src="{% static 'layui/layui.js' %}"></script>
    <script src="{% get_static_prefix %}bootstrap-3.3.7-dist/js/bootstrap.js"></script>
    <link rel="stylesheet" href="/static/bootstrap-3.3.7-dist/css/bootstrap.css">
    <link rel="stylesheet" href="{% static 'layui/css/layui.css' %}">
    {% block css %}
    {% endblock %}
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">社团活动报名系统</div>
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="/index/">首页</a></li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            {% if request.user.is_authenticated %}
                <li class="layui-nav-item">
                <a href="javascript:;">
                    <i class="layui-icon layui-icon-username"></i>
                    {{ request.user }}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="/backend/">个人中心</a></dd>
                    <hr>
                    <dd><a href="/change_pwd/">修改密码</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="/logout/">注销</a></li>
            {% else %}
                <li class="layui-nav-item"><a href="/login/">登录</a></li>
            {% endif %}
        </ul>
    </div>

    <div>
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">
            {% block middle %}

            {% endblock %}
        </div>
    </div>
</div>
</body>
<script>
    //注意：导航 依赖 element 模块，否则无法进行功能性操作
    layui.use('element', function () {
        var element = layui.element;

        //…
    });
</script>
{% block js %}

{% endblock %}
</html>